package day03;
//if...else的结构演示
public class IfelseifDome {
    public static void main(String[] args) {
        /*
        if...else if语句
        if(boolean){
        }else if(boolean){
        }else if(boolean){
        }else if(boolean){
        }else{
        }
         */
        //满2000打5折,满1000不满2000打7折,满500不满1000打8折,不满500打9折
        double price=3000.0;
        if (price>=2000){//如果值大于2000则执行第一个语句块,否则,根据其他的boolean的条件往下执行语句块
            price*=0.5;
        }else if(price>=1000){
            price*=0.7;
        }else if (price>=500){
            price*=0.8;
        }else {
            price*=0.9;
        }
        System.out.println("最终消费金额为:"+price);
        double price1=1000.0;
        if (price1>=2000){
            price1*=0.5;
        }else if(price1>=1000){
            price1*=0.7;
        }else if(price1>=500){
            price1*=0.8;
        }else {
            price1*=0.9;
        }
        System.out.println(price1);
        double price2=300;
        if(price2>=2000){
            price2*=0.5;
        }else if(price2>=1000){
            price2*=0.7;
        }else if(price2>=500){
            price2*=0.8;
        }else {
            price2*=0.9;
        }
        System.out.println(price2);
    }
}
